package com.op.teachingliteapp.fragment;


import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Toast;

import com.op.teachingliteapp.R;
import com.op.teachingliteapp.activity.Main_Two;
import com.op.teachingliteapp.fragment.add_class.indexablelistview.IndexableListViewFragment;

public class cloud_class extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.cloud_class, container,false);
		
		rootView.findViewById(R.id.C_Language).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(getActivity(), "C语言入门", Toast.LENGTH_SHORT).show();
				Intent i =new Intent(getActivity(),Main_Two.class);
				startActivity(i);
			}
			
		});
		rootView.findViewById(R.id.php).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(getActivity(), "PHP入门", Toast.LENGTH_SHORT).show();
			}
			
		});
		//添加课程
		rootView.findViewById(R.id.add).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(getActivity(), "添加课程", Toast.LENGTH_SHORT).show();
				getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.main_show, new IndexableListViewFragment()).commit();
			}
		});
		

		return rootView;
	}

	
	
	
	
}
